import SvgIcon from "./svgIcon.vue";
import Icon from "./icon.vue";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

const allGlobalComponents = { SvgIcon, Icon };

export default {
  // 务必叫做install方法
  install(app: any) {
    // 注册全部的全局组件
    Object.entries(allGlobalComponents).forEach(([key, value]) => {
      app.component(key, value);
    });
    // element-plus-icons作为全局组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  },
};
